package com.example.demo.services.imp;

import com.example.demo.entity.Report;
import com.example.demo.entity.ReportGli;
import com.example.demo.entity.reportModel;
import com.example.demo.mapper.ReportMapper;
import com.example.demo.services.ReportService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ReportServiceImp implements ReportService {

    @Autowired
    private ReportMapper reportMapper;

    @Override
    public reportModel selectall() {
        return reportMapper.selectall();
    }

    @Override
    public Integer addSet(Report report) {
        return reportMapper.addSet(report);
    }

    @Override
    public PageInfo<ReportGli> selectAdmin(Integer page,Integer size) {
        PageHelper.startPage(page,size);
        List<ReportGli> list=reportMapper.selectGli();
        PageInfo<ReportGli> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
}
